# pip install llama-index-embeddings-huggingface
# pip install llama-index-embeddings-instructor

# pip install llama-index-embeddings-ollama
from llama_index.embeddings.huggingface import HuggingFaceEmbedding

# 本地模型
def embed_model_local_bge_small(**kwargs):
    embed_model = HuggingFaceEmbedding(model_name="BAAI/bge-small-zh-v1.5",
                                       cache_folder=r"C:\Users\86134\Desktop\workspace\AI\ai_development_005\embed_cache",
                                       **kwargs)
    return embed_model
# 在线模型
def embed_model_ollama_nomic(**kwargs):
    from llama_index.embeddings.ollama import OllamaEmbedding

    ollama_embedding = OllamaEmbedding(
        model_name="nomic-embed-text:latest",
        base_url="http://123.60.22.2:11434",
    )
    return ollama_embedding